﻿using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Options;

namespace PHMEE.Identity
{
    public class CustomIdentityOptionsManager : AbpDynamicOptionsManager<IdentityOptions>
    {
        public CustomIdentityOptionsManager(IOptionsFactory<IdentityOptions> factory, IConfiguration configuration) : base(factory)

        {
            Configuration = configuration;
        }

        protected IConfiguration Configuration { get; }

        protected override Task OverrideOptionsAsync(string name, IdentityOptions options)
        {
            options.Password.RequireDigit = false;
            options.Password.RequiredLength = 6;
            options.Password.RequireNonAlphanumeric = false;
            options.Password.RequireUppercase = false;
            options.Password.RequireLowercase = false;

            return Task.CompletedTask;

        }
    }
}
